package com.salesmanager.core.business.category.model.status;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Liutong on 8/4/15.
 */
public enum CategoryStatus {
    PUBLISHED("已发布"),
    UNPUBLISHED("未发布"),
    HIDDEN("已隐藏"),
    DELETED("已删除")
    ;

    CategoryStatus(String value) {
        this.value = value;
    }

    private String value;
    private static Map<String,CategoryStatus> map = new HashMap<String, CategoryStatus>();
    public String getValue() {
        return value;
    }

    static {
        for (CategoryStatus status : CategoryStatus.values()){
            map.put(status.toString(),status);
        }
    }

    public static CategoryStatus getByValue(String value){
        return map.get(value);
    }
}
